package com.alibaba.cloud.dubboprovider;

import org.apache.dubbo.config.annotation.DubboService;

import java.util.Date;
import java.util.concurrent.TimeUnit;

/**
 * <p> 实现回声接口 </p>
 *
 * @author Chris
 * @since 2022/11/14 14:44
 */
@DubboService
public class FooService implements com.alibaba.cloud.serviceapi.FooService {


    @Override
    public String sayHello(String name) {
        return "Hello, " + name;
    }

    @Override
    public Date getCurrentTime(Integer slowSeconds) {
        try {
            TimeUnit.SECONDS.sleep(slowSeconds);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return new Date();
    }

}